<template>
  <div>
    <h1>爷组件</h1>
    <hr />
    <Son :callback="backdata"></Son>
    <p>{{ name + age }}</p>
  </div>
</template>

<script>
import Son from "./子组件.vue";
export default {
  components: {
    Son,
  },
  methods: {
    backdata(data) {
      console.log("孙子传来的数据：", data);
      this.name = data.name;
      this.age = data.age;
    },
  },
  data() {
    return {
      name: "",
      age: 0,
    };
  },
};
</script>

<style scoped>
</style>